package org.nanfang.test13;

import java.util.concurrent.Callable;

public class Count implements Callable<Integer> {
    private  int sum;  // 定义全局的总和的变量
    private int end;
    public Count(int sum,int end){
        this.sum = sum;
        this.end = end;
    }

    @Override
    public Integer call() throws Exception {
        for (int i = 0;i <end ; i++){
            sum += i;
        }
        return 1000;
    }
}
